package com.hkts.beltweigher.utils;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

/**
 * @ClassNameCustomPage
 * @Description
 * @Author yck
 * @Date2020-07-28 15:07
 * @Version V1.0
 **/
@ApiModel(description = "自定义分页")
public class CustomPage<T> {
    @ApiModelProperty(value = "页数")
    @Getter
    @Setter
    private Long pageNumber;
    @ApiModelProperty(value = "每页行数")
    @Getter
    @Setter
    private Long pageSize;
    @ApiModelProperty(value = "总共多少行")
    @Getter
    @Setter
    private Long totalRows;
    @ApiModelProperty(value = "总共多少页")
    @Getter
    @Setter
    private Long totalPages;
    @ApiModelProperty(value = "数据")
    @Getter
    @Setter
    private T resultData;
    @ApiModelProperty(value = "第一行")
    @Setter
    private long firstRow;
    @ApiModelProperty(value = "最后一行")
    @Setter
    private long lastRow;

    public long getFirstRow() {
      long ff=  pageSize*(pageNumber-1);
        return ff;
    }

    public long getLastRow() {
        long ll=  pageSize;
        return ll;
    }
}
